import { createWebHashHistory, createRouter } from 'vue-router';

// 路由守卫
import guarder from './guarder.js';

// 公共路由
export const constantRoutes = [
	// {
	// 	path: '/',
	// 	name: '/',
	// 	redirect: '/home',
	// 	component: () => import('@/extension/layout/index.vue'),
	// 	children: [
	// 		{
	// 			path: '/home',
	// 			name: '/home',
	// 			component: () => import('@/views/home/index.vue'),
	// 			meta: {
	// 				title: '首页',
	// 				hideTabs: true
	// 			}
	// 		},
	// 		{
	// 			path: '/profile',
	// 			name: '/profile',
	// 			component: () => import('@/views/system/user/profile/index.vue'),
	// 			meta: {
	// 				title: '个人信息',
	// 				hideTabs: true
	// 			}
	// 		}
	// 	]
	// },
	{
		path: '/Layout',
		name: '/Layout',
		component: () => import('@/extension/layout/index.vue'),
		children: [
			{
				path: '/profile',
				name: '/profile',
				component: () => import('@/views/system/user/profile/index.vue'),
				meta: {
					title: '个人信息',
					hideTabs: true
				}
			}
		]
	},
	{
		path: '/login',
		name: '/login',
		component: () => import('@/extension/login/login.vue'),
		meta: {
			title: '登陆页面',
			hideTabs: true
		}
	},
	{
		path: '/403',
		name: '/403',
		component: () => import('@/extension/exception/403.vue'),
		meta: {
			title: '403页面',
			hideTabs: true
		}
	},
	{
		path: '/404',
		name: '/404',
		component: () => import('@/extension/exception/404.vue'),
		meta: {
			title: '404页面',
			hideTabs: true
		}
	},
	{
		path: '/500',
		name: '/500',
		component: () => import('@/extension/exception/500.vue'),
		meta: {
			title: '500页面',
			hideTabs: true
		}
	},
	{
		path: '/512',
		name: '/512',
		component: () => import('@/extension/exception/512.vue'),
		meta: {
			title: '512页面',
			hideTabs: true
		}
	}
];

const router = createRouter({
	history: createWebHashHistory(),
	routes: constantRoutes
});

guarder(router);

export default router;
